<?php

namespace App\Models\Entrust;

use App\Models\User;
use Config;
use Zizaco\Entrust\EntrustRole;

class Role extends EntrustRole
{
    protected $fillable = ['name', 'description'];

    protected $hidden = [
        'display_name', 'created_at' ,'updated_at'
    ];

    public function users()
    {
        return $this->belongsToMany('App\Models\User', Config::get('entrust.role_user_table'), Config::get('entrust.role_foreign_key'), Config::get('entrust.user_foreign_key'));
    }

    public function perms()
    {
        return $this->belongsToMany('App\Models\Entrust\Permission', Config::get('entrust.permission_role_table'));
    }
}
